import { chatHttp, type IRes } from '@/utils/request';
import type { IFriendGroupItem, ICreateGroupParams, InviteFriendsParams } from './type';

// 获取好友列表
export const getFriendList = () =>
	chatHttp.get<IRes<IFriendGroupItem[]>>({
		url: 'friend/friend_list'
	});

// 创建群聊
export const createGroup = (data: ICreateGroupParams) =>
	chatHttp.post<IRes>({
		url: '/group/create_group',
		data
	});

// 邀请新的好友进入群聊
export const inviteFriend = (data: InviteFriendsParams) =>
	chatHttp.post<IRes>({
		url: '/group/invite_friend',
		data
	});
